Histogram Model for Image Objects with Depth


Sergei Papulin (papulin.edu@gmail.com)

Contents

Creating virtual environment

⚠️ Warning. You need at least 8GB RAM available to load the dataset

This is an optional step. You can skip it and install packages to your current environment.

python -m venv .venv/histtest
source .venv/histtest/bin/activate
pip install \
    numpy==1.19.5 \
    matplotlib==3.0.3 \
    jupyter==1.0.0 \
    pillow==5.4.1 \
    scikit-image==0.14.2 \
    mat73==0.55 \
    himpy=0.0.1

Load packages

Loading Dataset

Download the dataset from the NYU Depth Dataset V2 website:

Basic dataset fileds

Key Description
depths HxWxN matrix of in-painted depth maps where H and W are the height and width, respectively and N is the number of images. The values of the depth elements are in meters.
images HxWx3xN matrix of RGB images where H and W are the height and width, respectively, and N is the number of images.
instances HxWxN matrix of instance maps. Use get_instance_masks.m in the Toolbox to recover masks for each object instance in a scene.
labels HxWxN matrix of object label masks where H and W are the height and width, respectively and N is the number of images. The labels range from 1..C where C is the total number of classes. If a pixel’s label value is 0, then that pixel is ‘unlabeled’.
names Cx1 cell array of the english names of each class.
namesToIds map from english label names to class IDs (with C key-value pairs)
scenes Nx1 cell array of the name of the scene from which each image was taken.
sceneTypes Nx1 cell array of the scene type from which each image was taken.

Downloading Dataset

Images

Defining Positional Elements

Low-Level Elements

High-Level Elements

Defining Object Elements

Low-Level Elements

High-Level Elements

Defining Depth Elements

Low-Level Elements

High-Level Elements

Creating Histogram

Querying

Operations on Histogram Elements

Example for Union

Other operations

Image Retrieval

Expression as query

Sample image as query

References